package cn.project.dao;

import cn.project.model.User;

import org.springframework.jdbc.core.support.JdbcDaoSupport;

import java.util.List;

public class UserJdbcDaoSupport extends JdbcDaoSupport implements UserTempDao {

    /**
     * 此方法不需新建 属性 JdbcTemplate
     * @return
     */
    public List<User> getAllUser() {
        return null;
    }

    public List <User> getAllUser(User user) {
        return null;
    }

    public User findById(int userid) {
        return null;
    }

    public int save(User user) {
        String sql="insert into user(username,password) values(?,?)";
        Object[] params={user.getUsername(),user.getPassword()};
        return getJdbcTemplate().update(sql,params);

    }

    public int update(User user) {
        return 0;
    }

    public int delete(int userid) {

        return userid;
    }
}
